﻿using System;
using System.Collections.Generic;
using System.Text;

namespace AdaptiveAgents.Tools
{
    class AgentInfo
    {

        private int m_iIndex;
        private double m_dEpsilon;
        private double m_dCompetence;
        private double m_dProbability;
        private int m_iTurns;
        private IProbabilityCreator m_pProbabilityCreator;

        public AgentInfo(int index,double eps,double comp, IProbabilityCreator creator)
        {
            m_dCompetence = comp;
            m_dEpsilon = eps;
            m_iIndex = index;
            m_pProbabilityCreator = creator;
        }

        public AgentInfo(IProbabilityCreator creator) { m_pProbabilityCreator = creator; }

        public AgentInfo(int index, double eps, double comp, int turns, double probability, IProbabilityCreator creator)
        {
            m_dCompetence = comp;
            m_dEpsilon = eps;
            m_iIndex = index;
            m_iTurns = turns;
            m_dProbability = probability;
            m_pProbabilityCreator = creator;
        }

        public AgentInfo clone()
        {
            AgentInfo temp = new AgentInfo(m_iIndex, m_dEpsilon, m_dCompetence, m_iTurns, m_dProbability, new ProbabilityCreatorFirstVersion(m_dEpsilon));
            return temp;
        }

        public void setIndex(int index)
        {
            m_iIndex = index;
        }

        public void setEpsilon(double eps)
        {
            m_dEpsilon = eps;
        }

        public void setCompetence(double comp)
        {
            m_dCompetence = comp;
        }

        public void setProbabilities(double probab)
        {
            m_dProbability = probab;
        }

        public void setTurns(int turns)
        {
            m_iTurns = turns;
        }

        public int getIndex()
        {
            return m_iIndex;
        }

        public double getEpsilon()
        {
            return m_dEpsilon;
        }

        public double getCompetence()
        {
            return m_dCompetence;
        }

        public double getProbabilitiea()
        {
            return m_dProbability;
        }

        public int getTurns()
        {
            return m_iTurns;
        }

        public double getEpsilonTo0(int myLevel,int otherLevel)
        {
            return m_pProbabilityCreator.getEpsilonTo0(myLevel, otherLevel);
        }

        public double getEpsilonTo1(int myLevel, int otherLevel)
        {
            return m_pProbabilityCreator.getEpsilonTo1(myLevel, otherLevel);
        }

        public double getEpsilonTo2(int myLevel, int otherLevel)
        {
            return m_pProbabilityCreator.getEpsilonTo2(myLevel, otherLevel);
        }

       
    }
}
